<?php
/**
 * Created by PhpStorm.
 * User: s.utkin
 * Date: 20.02.2015
 * Time: 19:49
 */

class MultilangCity extends \Pinenut\Model2\MultilangModel {

	public $title;
	public $district;
	public $population;

	public function indexes()
	{
		return [
			'title' => [
				'title' => \Pinenut\Model2\Finder::ORDER_ASC,
				'population' => \Pinenut\Model2\Finder::ORDER_DESC,
			],

			'population' => [
				'population' => \Pinenut\Model2\Finder::ORDER_ASC
			],
		];
	}

	/**
	 * Возвращает список полей, которые должны быть мультиязычными
	 *
	 * @return array
	 */
	public static function multilangFields()
	{
		return [
			'title',
			'district'
		];
	}

	static function fields()
	{
		return array_merge(
			parent::fields(),
			[
				'title' => self::STRING,
				'district' => self::STRING,
				'population' => self::INT,
			]
		);
	}


}